/**
 * 循环语句
 *
 */
public class Hello8 {

    public static void main(String[] args) {
        Hello8 hello8 = new Hello8();
        //hello8.test();
        //hello8.test1();
        hello8.test2();
    }

    /**
     * while循环
     */
    public void test() {
        // while循环
        int j = 0;
        while (j < 5) {
            System.out.println("while循环第" + j + "次");
            j++;
        }
    }

    /**
     * do-while循环
     */
    public void test1() {
        // do-while循环
        int k = 0;
        do {
            System.out.println("do-while循环第" + k + "次");
            k++;
        } while (k < 5);
    }

    /**
     * for循环
     */
    public void test2() {
        // for循环
//        for (int i = 0; i < 5; i++) {
//            System.out.println("for循环第" + i + "次");
//        }

        int i = 0;
        for (; i < 5; i++) {
            System.out.println("for循环第" + i + "次");
        }

//        for (int m = 0, j = 10; m < 5; m++, j--) {
//            System.out.println("m: " + m + ", j: " + j);
//        }

    }

}
